.MODEL SMALL
.STACK 64
.DATA
		
		TOPROW		EQU		08
		BOTROW		EQU		16
		LEFTCOL		EQU		26
		LEN_LINE	EQU		19
		ATRIBUTO	DB		?
		COL			DB		00
		ROW			DB		00
		SHADOW		DB		19	DUP(0DH)
		MENU		DB		0C9H,	17 DUP(0CDH), 	0BBH
					DB		0BAH,	' ADD RECORDS     ', 0BAH
					DB		0BAH,	' DELETE RECORDS  ', 0BAH
					DB		0BAH, 	' ENTER ORDERS    ', 0BAH
					DB		0BAH, 	' PRINT REPORT    ', 0BAH
					DB		0BAH,   ' UPDATE ACCOUNTS ', 0BAH
					DB		0BAH, 	' VIEW RECORDS    ', 0BAH
					DB		0BAH,   ' EXIT PROGRAM    ', 0BAH
					DB		0C8H,	17 DUP(0CDH), 	0BCH
		PROMPT		DB		'Utilice el boton derecho del mouse,'
					db		'para seleccionar una opcion.'
.386
.CODE
A10MAIN		PROC	FAR
			MOV		AX, @data	
			MOV		DS, AX
			MOV		ES, AX
			CALL	Q10CLEAR
			CALL	B10INITZ
			CMP		AX, 00
			JE		A90
			CALL	C10MENU
A20:
			MOV		ROW, TOPROW+1
			MOV		ATRIBUTO, 16H
			CALL	E10DISPLY
			CALL	D10POINTR
			CMP		DX, BOTROW-1
			JNE		A20
			MOV		AX, 02H
			INT		33H
			MOV		AX, 0600H
			CALL	Q10CLEAR
A90:
			MOV		AX, 4C00H
			INT		21H
A10MAIN		ENDP


B10INITZ	PROC	NEAR
			MOV		AX, 00H
			INT		33H
			CMP		AX, 00H
			JE		B90
			MOV		AX, 01H
			INT		33H
			MOV		AX, 04H
			MOV		CX, 256
			MOV		DX, 108
			INT		33H
			MOV		AX, 07H
			MOV		CX, LEFTCOL+1
			MOV		DX, LEFTCOL+17
			SHL		CX, 03
			SHL		DX, 03
			INT 	33H
			MOV		AX, 08H
			MOV		CX, TOPROW+1
			MOV		DX, BOTROW-1
			SHL		CX, 03
			SHL		DX, 03
			INT 	33H
B90:
			RET
B10INITZ	ENDP

C10MENU		PROC	NEAR
			MOV		AH, 1301H
			MOV		BX, 0060H
			LEA		BP, SHADOW
			MOV		CX, LEN_LINE
			MOV		DH, TOPROW+1
			MOV		DL, LEFTCOL+1
C20:
			INT		10H
			INC		DH
			CMP		DH, BOTROW+2
			JNE		C20
			MOV		ATRIBUTO, 71H
			MOV		AX, 1300H
			MOV		BH, 00
			MOV		BL, ATRIBUTO
			LEA		BP, MENU
			MOV		CX, LEN_LINE
			MOV		DH, TOPROW
			MOV		DL, LEFTCOL
			INT		10H
			ADD		BP, LEN_LINE
			INC		DH
			CMP		DH, BOTROW+1
			JNE		C30
			MOV		AX, 1300H
			MOV		BH, 00
			MOV		BL, ATRIBUTO
			LEA		BP, PROMPT
			MOV		CX, 45
			MOV		DH, BOTROW+4
			MOV		DL, 15
			INT 	10H
			RET
C10MENU		ENDP			


D10POINTR	PROC	NEAR
D20:
			MOV		AX, 03H
			INT		33H
			CMP		BX, 00000001B
			JNE		D20
			SHR		DX, 03
			CMP		DX, BOTROW-1
			JE		D90
			PUSH	DX
			MOV		ATRIBUTO, 71H
			CALL	E10DISPLY
			JMP		D20
D90:
			RET
D10POINTR	ENDP


E10DISPLY	PROC	NEAR
			MOVZX	AX, ROW
			SUB		AX, TOPROW
			IMUL	AX, LEN_LINE
			LEA		SI, MENU+1
			ADD     SI, AX
			MOV		AX, 1300H
			MOV 	BH, 00
			MOV		BL, ATRIBUTO
			MOV 	BP, SI
			MOV 	CX, LEN_LINE-2
			MOV		DH, ROW
			MOV		DL, LEFTCOL+1
			INT 	10H
E10DISPLY	ENDP	


Q10CLEAR	PROC 	NEAR
			MOV		AX, 0600H
			MOV		BH, 61H
			MOV		CX, 0000
			MOV		DX, 184FH
			INT		10H
			RET
Q10CLEAR	ENDP
			END		A10MAIN
			
		
					
		